Tags: multiple outputs, lecture-16, softmax
A neural network with 3 output nodes uses the softmax activation function. The pre-activation values (logits) at the output layer are \(\vec z = (0, 2, 0)\). Compute the softmax output \(\vec h = (h_1, h_2, h_3)\).
Leave your answer in terms of \(e\).
By the softmax formula, \(h_k = \frac{e^{z_k}}{\sum_{j=1}^{3} e^{z_j}}\). The denominator is:
Therefore:
Tags: multiple outputs, lecture-16, softmax
A neural network with 4 output nodes uses the softmax activation function. The pre-activation values (logits) at the output layer are \(\vec z = (1, 3, 1, 3)\). Compute the softmax output \(\vec h = (h_1, h_2, h_3, h_4)\).
Leave your answer in terms of \(e\).
By the softmax formula, \(h_k = \frac{e^{z_k}}{\sum_{j=1}^{4} e^{z_j}}\). The denominator is:
Therefore:
Tags: multiple outputs, lecture-16, softmax
A neural network with 3 output nodes uses the softmax activation function. The pre-activation values (logits) at the output layer are \(\vec z = (1, 2, 3)\). Compute the softmax output \(\vec h = (h_1, h_2, h_3)\).
Leave your answer in terms of \(e\).
By the softmax formula, \(h_k = \frac{e^{z_k}}{\sum_{j=1}^{3} e^{z_j}}\). The denominator is:
Therefore:
Tags: binary cross-entropy, lecture-16, multiple outputs
A multi-label classifier has 3 output nodes with sigmoid activations. The true labels are \(\vec y = (1, 0, 1)\) and the predicted probabilities are \(\vec h = (0.9, 0.2, 0.8)\).
Compute the binary cross-entropy loss. Leave your answer in terms of \(\log\).
\(-\log(0.9) - \log(0.8) - \log(0.8) = -\log(0.9) - 2\log(0.8)\).
By the binary cross-entropy formula:
Evaluating each term:
The total is \(-\log(0.9) - 2\log(0.8)\).
Tags: binary cross-entropy, lecture-16, multiple outputs
A multi-label classifier has 4 output nodes with sigmoid activations. The true labels are \(\vec y = (0, 1, 0, 1)\) and the predicted probabilities are \(\vec h = (0.3, 0.7, 0.1, 0.9)\).
Compute the binary cross-entropy loss. Leave your answer in terms of \(\log\).
\(-2\log(0.7) - 2\log(0.9)\).
By the binary cross-entropy formula:
Evaluating each term:
The total is \(-2\log(0.7) - 2\log(0.9)\).
Tags: binary cross-entropy, lecture-16, multiple outputs
A multi-label classifier has 3 output nodes with sigmoid activations. The true labels are \(\vec y = (1, 1, 0)\) and the predicted probabilities are \(\vec h = (0.8, 0.6, 0.4)\).
Compute the binary cross-entropy loss. Leave your answer in terms of \(\log\).
\(-\log(0.8) - 2\log(0.6)\).
By the binary cross-entropy formula:
Evaluating each term:
The total is \(-\log(0.8) - 2\log(0.6)\).
Tags: multiple outputs, lecture-16, categorical cross-entropy
A multi-class classifier has 4 output nodes with softmax activation. The true label is \(\vec y = (0, 0, 1, 0)\) and the softmax outputs are \(\vec h = (0.1, 0.2, 0.6, 0.1)\).
Compute the categorical cross-entropy loss. Leave your answer in terms of \(\log\).
\(-\log(0.6)\).
By the categorical cross-entropy formula:
Only \(y_3 = 1\) contributes, so the loss is \(-\log(h_3) = -\log(0.6)\).
Tags: multiple outputs, lecture-16, categorical cross-entropy
A multi-class classifier has 3 output nodes with softmax activation. The true label is \(\vec y = (0, 1, 0)\) and the softmax outputs are \(\vec h = (0.3, 0.5, 0.2)\).
Compute the categorical cross-entropy loss. Leave your answer in terms of \(\log\).
\(-\log(0.5) = \log 2\).
By the categorical cross-entropy formula:
Only \(y_2 = 1\) contributes, so the loss is \(-\log(h_2) = -\log(0.5) = \log 2\).
Tags: multiple outputs, lecture-16, categorical cross-entropy
A multi-class classifier has 4 output nodes with softmax activation. The true label is \(\vec y = (1, 0, 0, 0)\) and the softmax outputs are \(\vec h = (0.4, 0.3, 0.2, 0.1)\).
Compute the categorical cross-entropy loss. Leave your answer in terms of \(\log\).
\(-\log(0.4)\).
By the categorical cross-entropy formula:
Only \(y_1 = 1\) contributes, so the loss is \(-\log(h_1) = -\log(0.4)\).
Tags: multiple outputs, sigmoid, lecture-16, softmax
A neural network classifies images into 5 categories.
Suppose the categories are mutually exclusive (each image belongs to exactly one category). Which activation function should be used at the output layer: sigmoid or softmax?
Softmax.
Since the categories are mutually exclusive, we want the output probabilities to represent a single probability distribution over the 5 classes. Softmax enforces this by ensuring the outputs sum to 1.
True or False: with the activation from part (a), the 5 outputs must sum to 1.
True.
The softmax function produces outputs that sum to 1 by definition:
Now suppose an image can belong to multiple categories simultaneously. Which activation function should be used at the output layer: sigmoid or softmax?
Sigmoid.
Since the categories are not mutually exclusive, each output node independently predicts the probability that the image belongs to that category. Sigmoid is applied independently to each output.
True or False: with the activation from part (c), the 5 outputs must sum to 1.
False.
Sigmoid is applied independently to each output node, so there is no constraint that the outputs sum to 1. For example, if the image contains both a cat and a dog, the network might output high probabilities for both.
Tags: multiple outputs, lecture-16, regression
A neural network with 3 output nodes is trained to predict temperature, humidity, and wind speed simultaneously. The network uses the multi-target regression loss:
For a particular data point, the network's predictions are \(\vec h = (5, 3, 7)\) and the true values are \(\vec y = (3, 4, 5)\). Compute the loss.
\(9\).